<?php 
/* Template name: Homepage */ 
?>

<?php get_header(); ?>
<!-- SLIDER -->
   <?php if (get_option('of_rev_slider') == 'is_on'){ ?>
<?php putRevSlider(get_option('of_slider_home_set')); ?> 
<?php } ?>
<!-- /SLIDER --> 

<!--PAGE CONTENT-->
<div class="green_box">
<div class="container">
 <!--Homepage Tagline -->
  <?php if (get_option('of_hp_titles') == 'is_on'){ ?>
  	<div class="row">
		<div class="span12">
			<div class="page-header">
               <h1><?php echo get_option('of_hp_main_title'); ?><br>
               <small><?php echo get_option('of_hp_main_title_description'); ?></small>
               </h1>
        	</div>
		</div>
	</div>			
<?php } ?>
</div>
</div>
<!--/Homepage Tagline -->

  <div class="container">      
<!--Latest-works -->
<?php if (get_option('of_hp_thumbs') == 'is_on'){ ?>
      <?php if (get_option('of_portfolio_title_off') == 'true'){  // Hide/show Content Title ?>
      <div class="areatitle_black"><h2><?php echo get_option('of_hp_portfolio_title');?></h2></div>
	<?php } else{ ?><?php } ?> 
<div id="latest-works">
	<div class="row">
		<div class="span12">
			<ul class="thumbnails">
<?php
if ( have_posts() ) :
$args = array( 'post_type' => 'portfolio', 'posts_per_page' => 6 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>

<?php 
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'home_latest_portfolio_img' ); 
if ($image) : ?>
                    <li>
                    <a href="<?php the_permalink(); ?>">
                         <img src="<?php echo $image[0]; ?>" alt="" />
                         <?php endif; ?> 
                         <section class="overlay">
                            <a href="<?php the_permalink(); ?>" class="zoom-btn"></a>
                         </section>
                     </a>
                    </li>
                        <?php
								endwhile;
							endif;
							wp_reset_query();
						?>
                                                                               
                         </ul>
			</div>
		</div>

</div>
<?php } ?>
<!--/Latest-works -->
 </div>      <div class="trquaz_box">
 <div class="container">      
<!--/Latest Post -->
<?php if (get_option('of_latestblog_titles') == 'is_on'){ ?>
 <?php if (get_option('of_blog_title_off') == 'true'){  // Hide/show Content Title ?>
 <div class="areatitle"><h2><?php echo get_option('of_hp_blog_title');?></h2></div>
		<?php } else{ ?><?php } ?>
<div id="mini-post">
	<div class="row">
		<div class="span12">
                                        
<?php
$loop = new WP_Query('post_type=post&showposts=2'); 
if($loop->have_posts()) : while($loop->have_posts()) : $loop->the_post();
?>
<?php 
$format = get_post_format(); 
if( false === $format ) { $format = 'standard'; }
?>
				<article class="mini-post">
<?php if( $format == 'standard' || $format == 'gallery' || $format == 'image' || $format == 'video' || $format == 'audio' ) { ?>
                
                 <?php } ?>
                  <?php if($format == 'aside') { ?>
                    <div class="text">
                        <p><?php the_content(); ?></p>
                    </div>
                     
                        
                   <?php } else if($format == 'quote') { ?>
					<div class="posttype entry-quote">
                       <h2><?php echo get_post_meta($post->ID, $prefix.'_quote', true); ?></h2>
                       <p class="quote-source">- <?php the_title(); ?></p> 
                     </div>
                       <p><?php the_content(); ?></p>
                
                    <?php } else if($format == 'link') { ?>
                  
                    <div class="posttype entry-link">
                      <h2><a href="<?php echo get_post_meta($post->ID, $prefix.'_link', true); ?>" target="_blank"><?php the_title(); ?></a></h2>
                    </div> 

                    <p class="absolute-text"><a href="<?php echo get_post_meta($post->ID, $prefix.'_link', true); ?>" target="_blank"><?php echo get_post_meta($post->ID, $prefix.'_link', true); ?></a></p>
                    					
                    <p class="text"><?php cl_excerpt('cl_excerptlength_folio', 'cl_excerptmore'); ?></p>
                        
<?php }	else if($format == 'standard' || $format == 'audio' || $format == 'video' || $format == 'image' || $format == 'gallery') { ?>
					<?php get_template_part( 'home-posttypes/' . $format ); ?>
					<?php }  ?>
                    <a style="text-decoration:none" href="<?php the_permalink() ?>"> <div class="morelink">Read More</div></a>
			</article>
			<?php 
          endwhile; endif; 
         ?>
		</div>
	</div>
</div>
<?php } ?>
<!--/Latest Post -->
	 </div>  </div>    
 <div class="container"> 		
<!--Featured Text and Button -->
  <?php if (get_option('of_featured_titles') == 'is_on'){ ?>

            <div class="buy-now"><h1><?php echo get_option('of_featured_main_title'); ?><br />
            <small><?php echo get_option('of_featured_main_desc'); ?></small></h1>
            <a style="text-decoration:none;" href="<?php echo get_option('of_featured_button_url'); ?>"><button class="btn2"><?php echo get_option('of_featured_button_text'); ?></button></a>
            </div>

            <?php } ?>
<!--/Featured Text and Button --> 
    </div>   
     <div class="bold_box">     
 <div class="container">          
<!-- Clintes -->
   <?php if (get_option('of_hp_clients') == 'is_on'){ ?>
    <div class="areatitle"><h2><?php echo get_option('of_hp_clients_title'); ?></h2></div>
                                   
<div class="clients">
	<div class="row">
		<div class="span12">
			<div class="row">

              <div class="span2"><a href="<?php echo get_option('of_client1_url'); ?>"><img src="<?php echo get_option('of_client1_logo'); ?>" alt=""></a></div>
                            
              <div class="span2"><a href="<?php echo get_option('of_client2_url'); ?>"><img src="<?php echo get_option('of_client2_logo'); ?>" alt=""></a></div>
                            
              <div class="span2"><a href="<?php echo get_option('of_client3_url'); ?>"><img src="<?php echo get_option('of_client3_logo'); ?>" alt=""></a></div>
                            
              <div class="span2"><a href="<?php echo get_option('of_client4_url'); ?>"><img src="<?php echo get_option('of_client4_logo'); ?>" alt=""></a></div>
                            
              <div class="span2"><a href="<?php echo get_option('of_client5_url'); ?>"><img src="<?php echo get_option('of_client5_logo'); ?>" alt=""></a></div>
                            
              <div class="span2"><a href="<?php echo get_option('of_client6_url'); ?>"><img src="<?php echo get_option('of_client6_logo'); ?>" alt=""></a></div>
                            
			</div>
		</div>
	</div>
</div>
<?php } ?>
<!-- /Clintes -->    
</div></div>
<!-- /PAGE CONTENT-->

   <?php get_footer(); ?>


  